function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}


var field_type="";
var field_value="";

function createPopup(c,delf){
		var containerDiv = document.createElement('div'); //popup container
		containerDiv.className="popup-container";
		$(c).after(containerDiv);
		var popupDiv = document.createElement('div'); //popup container
		$(containerDiv).append(popupDiv);
		popupDiv.className = 'popup';			
		var aDelete= document.createElement('div'); //popup delete
		aDelete.innerHTML="Delete";
		aDelete.className="popup-delete";
		$(popupDiv).append(aDelete);

		$(aDelete).click(delf);
}


function showPopup(e){
	if($(this).children("input").length==1) return;			
	$(".sort").attr("name",$(this).attr("name"));
	field_type=$(this).attr("type");
	field_value=$(this).attr("value");

	var x=e.pageX;
	if(x>5) x=x-5;
	var y=e.pageY;
	if(y>5) y=y-5;
	$(".popup").css("left",x);
	$(".popup").css("top",y);
	$(".popup").css("visibility","visible");

	//Popup function
	$(".popup-container").hover(function(){
		},function(){
			$(".popup").css("visibility","hidden");
		} 
	);
}
